package com.baizhi.controller;

import com.baizhi.entrty.Banner;
import com.baizhi.entrty.Guru;
import com.baizhi.service.GuruService;
import com.baizhi.service2.GuruService2;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Controller
public class GuruController {
    private Logger logger = LoggerFactory.getLogger(GuruController.class);
    @Autowired
    private GuruService gs;
    @Autowired
    private GuruService2 gs2;

    @RequestMapping("fyg")
    @ResponseBody
    public Map fy(int page, int rows){

        return gs.fy(page,rows);
    }

    @RequestMapping("insertg")
    @ResponseBody
    public Map insert(Guru gu){

        logger.info("Guru"+gu);

        return gs2.insert(gu);
    }

    @RequestMapping("djg")
    @ResponseBody
    public Map dj(int[] id){

        System.out.println(id+"----------");
        System.out.println(id+"----------");
        System.out.println(id+"----------");
        return  gs2.dj(id);
    }

    @RequestMapping("jdg")
    @ResponseBody
    public Map jd(int[] id){



        return gs2.jd(id);
    }


}
